home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / pcbri121.zip / COMPILE.DOC < prev    next >
Text File  |  1991-03-26  |  11KB  |  237 lines

  1.  
  2.                         Compiling New PCbridge code
  3.  
  4.     
  5.     The PCbridge distribution comes with precompiled versions of the code
  6. for the most common bridge configurations.  If your configuration is not
  7. one of these common ones, or if you want to modify the code in some
  8. special way, you will need to recompile it.  This document describes how 
  9. to do this.
  10.  
  11. WHAT YOU WILL NEED.
  12.  
  13.     The original source code was written using TURBO ASSEMBLER 1.0.  I have 
  14. made no attempt to check if the code will assemble with other assemblers, 
  15. but you are welcome to try.  Here I will assume that you have the TASM and 
  16. TLINK utilities that come with TURBO ASSEMBLER.   In addition, the
  17. compilation needs a FULL 640K of memory in order to compile.  Thus you
  18. need a PC with at least this much memory and you will probably have to
  19. remove any TSR programs so that TURBO ASSEMBLER has as much space as possible.
  20.  
  21.  
  22. CONFIGURING PCbridge.
  23.  
  24.     In order to change the interface configuration of PCbridge it is only 
  25. necessary to change one file, BRIDGE.ASM.  Near the top of this file
  26. declaration section that contains a description of each card in the bridge
  27. and it is this description that needs to be changed.  
  28.  
  29. ------------------------------------------------------------------------------
  30.  
  31. WD Ethernet Cards:
  32.  
  33. The easiest way to describe what is involved with configuring a WD ethernet
  34. interface is simply to look at an example.  Here is the declaration for
  35. the first WD8013EBT card.
  36.        
  37.     WDE_DECLARE %cur_if, 280H, 0D000H, 0H, 1, 64, 1  ;; promiscuous ,16K, 16bit
  38.     IF_DECLARE %cur_if, %cur_if, WDE
  39.     cur_if = cur_if + 1
  40.  
  41. The first line declares a WD800X card.  The meaning of of the 
  42. parameters to the WDE_DECLARE statement is
  43.  
  44.     Parameter
  45.  
  46.         1       The name of the card.  This never changes, it is always %cur_if
  47.  
  48.         2       Is the I/O address of the card.  This number is basically 
  49.                 arbitrary as long as it does not conflict with anything and 
  50.                 you set the DIP switches on the WD800X card to agree with 
  51.                 this number.  In general I choose 280H for the first card 
  52.                 2A0H for the second card, 2C0H for the third card etc.   
  53.                 I recommend this pattern.
  54.  
  55.         3,4     This is the address (segment, offset) of the shared memory.   
  56.                 It must be above 80000H (512K) and it can't conflict with 
  57.                 other device memory (like video memory).   Most PCs have 
  58.                 a free region D0000H-DFFFFH and A0000H-AFFFFH, so I recommend 
  59.                 using these.  To simplify configuration I give each WD800X 
  60.                 card a region that has a full 32K of memory even though the 
  61.                 WD80013EBT and the WD8003E will not use all of it.  Thus I 
  62.                 reserve D0000H-D7FFFH for the first card, D8000H-DFFFFH for 
  63.                 the second A0000H-A7FFFFH for the third etc.
  64.     
  65.         5       This flag, that indicates promiscuous mode, is always 1 
  66.                 for bridges.
  67.  
  68.         6       This is the number of 256byte 'pages' of shared memory
  69.                 on the card.  WD8003E have 8K = 32 pages, WD8003EBT have
  70.                 32K = 128 pages, and the WD8013EBT have 16K = 64 pages.
  71.  
  72.         7       This flag, that indicates a 16 bit data path, is 1 for 
  73.                 the WD80013EBT card.  Otherwise it is either 0 or blank.
  74.  
  75. The second line declares that the code for the WD800X implements a IF 
  76. software interface and that the names of the functions all begin with the
  77. prefix 'WDE'.   This line never changes.
  78.  
  79. Thus to configure Ethernet (or Starlan) cards, all you need do do is
  80. have a set of three lines like the ones above with the proper parameters
  81. to the WDE_DECLARE line.  There are templates in the BRIDGE.ASM file that
  82. have been commented out for various common cases.  Simply modify the
  83. template that is closest and comment it back in.
  84.  
  85. ------------------------------------------------------------------------------
  86.  
  87. 3Com 3c507 Ethernet Card:
  88.  
  89. The declaration for the 3c507 card looks like
  90.        
  91.      C507_DECLARE %cur_if, 280H, 0D000H, 10000H, 1   ;; name,io,seg,len,prom
  92.      IF_DECLARE %cur_if, %cur_if, C507
  93.      cur_if = cur_if + 1
  94.  
  95. The first line declares a 3C507 card.  The meaning of of the parameters to 
  96. the this statement is
  97.  
  98.     Parameter
  99.  
  100.         1       The name of the card.  This never changes, it is always %cur_if
  101.  
  102.         2       Is the I/O address of the card.  This number is basically 
  103.                 arbitrary as long as it does not conflict with anything and 
  104.                 you configure the 33c507 card to to agree with this number.  
  105.                 In general I choose 280H for the first card 2A0H for the 
  106.                 second card, 2C0H for the third card etc.   I recommend this 
  107.                 pattern.
  108.  
  109.         3       This is the SEGMENT address of the shared memory.   (Thus
  110.                 the value D000H cooresponds to D0000H in the address space).
  111.                 Most PCs have a free region D0000H-DFFFFH and C0000H-CFFFFH, 
  112.                 so I recommend using these.   Note you should probably
  113.                 check with using 'debug' that these regions are in fact
  114.                 clear if you have any doubt.  This value must agree with
  115.                 the value set in the card.
  116.     
  117.         4       The Length of the shared memory.  The 3c507 has 64K of ram,
  118.                 but can be configured to use less.  This is only necessary
  119.                 if you are using more than two 3c507 cards.  In this case
  120.                 there is not enough address space for all the memory on all
  121.                 the cards.  Thus you should probably change this number
  122.                 to 32K (8000H), when this is the case.  This value must
  123.                 agree with the value set in the card
  124.  
  125.         5       This flag, that indicates promiscuous mode, is always 1 
  126.                 for bridges.
  127.  
  128. The second line declares that the code for the 3C507 card implements a IF 
  129. software interface and that the names of the functions all begin with the
  130. prefix 'C507'.   This line never changes.
  131.  
  132. ------------------------------------------------------------------------------
  133.  
  134. Serial Cards:
  135.  
  136. The declaration for a serial interface is more complicated.  It looks
  137. like this.
  138.  
  139.         ;; a serial card for a remote bridge
  140.      I8250_DECLARE %cur_if, SLIP, %cur_if, IBM_COM1_PORT, IBM_COM1_IRQ, 0
  141.      tmp = cur_if*100                                 ;; generate temp names
  142.      BUFF_DECLARE %(tmp+1), 3200                      ;; the read buffer
  143.      QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry)     ;; the read queue
  144.      BUFF_DECLARE %(tmp+3), 10240                     ;; the write buffer
  145.      QUEUE_DECLARE %(tmp+4), 16, %(size qif_entry) ;; the write queue
  146.      SLIP_DECLARE %cur_if,%cur_if,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
  147.      MY_SET_MTU %cur_if, 1518                         ;; overide default MTU
  148.      Q_IF_DECLARE %cur_if,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_if
  149.      IF_DECLARE %cur_if, %cur_if, Q
  150.      cur_if = cur_if + 1
  151.  
  152. Luckily, the ONLY line you will ever need to modify is the I8250_DECLARE
  153. line and even on that line you will ever want to change parameters 4-6.
  154. Lets look at these parameters more closely.
  155.  
  156.     Parameter
  157.  
  158.         4       This is the I/O address of the serial port.  There is
  159.                 an standard place for the first 4 serial ports on the
  160.                 PC, and these have been given symbolic names of the
  161.                 form IBM_COM<number>_PORT.  Use these names if you can,
  162.                 or a hexidecimal number if the port is in a non-standard
  163.                 place.
  164.  
  165.         5       This is the Interrupt line (IRQ) for the serial port.  
  166.                 There are standard interrupt lines for the first 2 serial
  167.                 ports and these have been given names IBM_COM_<number>_IRQ.
  168.                 Note that standard IRQ for COM1 is 4 and the standard
  169.                 IRQ for COM2 is 3.  Often other non-standard hardware will 
  170.                 use these interrupt lines, so be sure that they are free
  171.                 before you use them.
  172.                 interrupt line
  173.  
  174.         6       This flag indicates if hardware flow control should be
  175.                 used.  If this flag is 1, then PCbridge will only send
  176.                 out characters if the RS232 signal CTS (clear to send)
  177.                 is asserted.  PCbridge does not need flow control because
  178.                 it can accept characters at the full baud rate, but
  179.                 it is possible that you are connecting the PCs with modems
  180.                 that can't handle the full baud rate all the time (compressing 
  181.                 modems for example).  By enabling this flag, and setting
  182.                 the modem properly, this feature will make sure PCbridge
  183.                 sends characters only as fast as the modem can transmit them.
  184.  
  185. ------------------------------------------------------------------------------
  186.  
  187. The Packet driver 
  188.  
  189. It is possible to use PCbridge with ethernet cards other than the 
  190. Western Digital ones by using the packet driver.  Unfortunately, this
  191. relatively slow and since EVERY packet has to be examined, it is very
  192. likely that many packet will be dropped.  Nevertheless some people may
  193. want to experiment with it, so here is the declaration.
  194.  
  195.      PKT_DECLARE %cur_if, 60H, 01, 1    ;; <name> <Int num> <Class (Eth=1), prom
  196.      IF_DECLARE %cur_if, %cur_if, PKT
  197.      cur_if = cur_if + 1
  198.  
  199. The only parmeter that might change is the second one to PKT_DECLARE.
  200. This parameter (in this case 60H) is the software interrupt used to 
  201. access the packet driver.  For EACH packet driver interface there must
  202. be a packet driver loaded that will respond to this interrupt.
  203.  
  204. =============================================================================
  205.  
  206. Compiling the software:
  207.  
  208. Once the BRIDGE.ASM file has been configured, compiling it could not
  209. be easier.  Simply type
  210.  
  211.         TASM bridge
  212.         TLINK bridge
  213.  
  214. and a new version of the bridge code called bridge.exe will be produced.
  215.  
  216. =============================================================================
  217.  
  218. Debugging:
  219.  
  220. For those of you that are modifying the code and wish to print out 
  221. debugging statements this is possible.  The file DEBUG.INC contains
  222. routines for doing just that.  The main routines are PRINT, PRINT_REG
  223. and DUMP_in_SI_CX.  PRINT simply prints a string.  PRINT_REG prints
  224. a string and the contents of any 16 bit register (in hex).  DUMP_in_SI_CX
  225. prints CX memory locations starting at SI using the named segment 
  226. register.  All of these routines modify NO registers so they can be
  227. used anywhere (except between a cmp and its jump instr).
  228.  
  229. Here is an example of how these macro look when they are called
  230.  
  231.     print <Starting program>
  232.     print_reg <SI = >, SI
  233.     print_reg <CX = >, CX
  234.     print <Dumping at SI for CX bytes>
  235.     dump_in_SI_CX DS
  236.  
  237.